<template>
	<!--意见反馈-->
	<view class="community">
		<view class="head_bg" style="position: relative;"></view>
		<view class="big_box" style="top: -190rpx;">
			<view class="guide_box">
				<textarea class="feedback_box" @input="textareaAInput" value="" placeholder="请在这里写下您对充电站的意见和建议，我们将认真对待您的反馈，并及时给您回复并答谢 。" />			
			</view>
		</view>
		<view class="foot">
		   <button type="button" class="cu-btn block bg-blue lg" @tap="toF()">提交反馈</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabIndex: 1,
				index: 0,
				textA:''
			}
		},
		methods: {
			toF(){
				let that=this;
				if(this.textA=='' || this.textA==null){
					uni.showToast({
						icon: 'none',
					    title: '请填写反馈意见'
					});
					return;
				}
				that.http.tokenreq({
					url: 'user/v1/addsuggestions',
					data: {
				    "suggestions_content":this.textA,
					}
				}).then((res) => {
					let e=res.data;
					if(e.code==0 && e.success){
					    uni.showModal({
					    	content:"感谢你的意见，我们会认真处理",
					    	showCancel:false,
					    	success: function (res) {
					    		if (res.confirm) {
					    			uni.redirectTo({
					    				url:'/pages/user/my/my'
					    			});
					    		}
					    	}
					    });
					}
				})
			},
			textareaAInput(e) {
			  this.textA = e.detail.value;
			},
		}
	}
</script>
<style>
	.foot{
		position: fixed;
		left: 0;
		bottom: 0;
		width:100%;
	}
	page{
		background-color: #FFFFFF;
	}
	.feedback_box{
		width: 100%;
	}
</style>
